#
#
CLEANFILES = *~
DISTCLEANFILES = *~

clx_includedir = @prefix@/include/clx

noinst_LTLIBRARIES = libsr.la

INCLUDES = -I../libbase

AM_CFLAGS = -fno-strict-aliasing
AM_YFLAGS = -d -t
AM_LFLAGS = --nounistd

SOURCES_common = sr.c sr_get.c sr_dir.c sr_enc.c sr_arg.c sr_type.c sr_walk.c \
		sr_LNP.c sr_ref.c sr_util.c sr_type_ext.c sr_io.c sr_debug.c \
		traverse.c sr.h sr_p.h sr_type.h sr_parser.h

if ECM_PARSER

BUILT_SOURCES = sr_parser.c sr_scan_dbg.c sr_scan_nodbg.c

sr_scan_dbg.c: sr_scan.l
	flex $(AM_LFLAGS) -d -o$@ $<

sr_scan_nodbg.c: sr_scan.l
	flex $(AM_LFLAGS) -o$@ $<

PARSER_SOURCES = sr_parser.y

else

PARSER_SOURCES = sr_parser.c

endif

if ECM_DEBUG

SCANNER_SOURCES = sr_scan_dbg.c

else

SCANNER_SOURCES = sr_scan_nodbg.c

endif

libsr_la_SOURCES = $(SOURCES_common) $(PARSER_SOURCES) $(SCANNER_SOURCES)

clx_include_HEADERS = libsr.h

EXTRA_DIST = sr_scan_dbg.c sr_scan_nodbg.c sr_scan.l
